Skip to content

Make getTranscripts cross-platform (remove Unix find dependency)#6

Open
jkarthid wants to merge 1 commit into
simeydk:masterfrom
jkarthid:fix/cross-platform-transcript-discovery
Open

Make getTranscripts cross-platform (remove Unix find dependency)#6
jkarthid wants to merge 1 commit into
simeydk:masterfrom
jkarthid:fix/cross-platform-transcript-discovery

Conversation

@jkarthid

@jkarthid jkarthid commented May 29, 2026

Copy link
Copy Markdown

What & why

npm run format is currently broken on Windows. scripts/format.js discovered transcripts by shelling out to a Unix file finder:

const { stdout } = await exec('find **/*.md')

On Windows, find is a text-search utility (not a file finder), so it fails immediately:

FIND: Parameter format not correct

It also implicitly depended on sh glob semantics (where ** collapses to *, matching only */*.md — one directory deep), which is fragile and shell-dependent.

Changes

  • Replace the find subprocess with a pure-Node fs.readdir walk in getTranscripts(). It reads each top-level podcast directory and collects its .md files, skipping hidden / node_modules / scripts folders.
  • Drop the now-unused util + child_process imports; add path.
  • Fill in the previously empty getTranscripts test (it had a // TODO and zero assertions) with checks that it returns a non-empty list of one-level-deep .md paths.

Behavior

Faithful to the original "one directory deep" matching, so root files like README.md are still never touched. Verified locally: getTranscripts() returns 2005 transcripts, all .md, none at the repo root.

Testing

npm run format:test → 15/15 tests pass (including the new assertions). The fix makes npm run format runnable on Windows, macOS, and Linux without relying on any external command.

format.js discovered transcripts via `find **/*.md`, which fails on
Windows (find is a text-search tool there) and relied on sh glob
semantics. Replace it with a pure-Node fs.readdir walk that collects
transcripts one directory deep, skipping hidden/node_modules/scripts
folders. Also add assertions to the previously empty getTranscripts test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant